#include "include.h"
#include "func.h"
#include "func_music.h"
#include "func_exspiflash_music.h"

#if 0//(EX_SPIFLASH_SUPPORT)
#if EXFLASH_MUSIC_WARNING
void wav_output_play(void);
#endif


AT(.text.func.music.msg)
void func_exspifalsh_music_message(u16 msg)
{
#if SPIFALSH_MUSIC_PLAY_REC
    u32 rec_total = 0;
#endif
	if(msg!=0&&msg!=0x7ff&&(msg&0x800))
	{
		printf("msg:0x%x",msg);
	}
    switch (msg) {
        case K_SONG:
			exspifalsh_music_switch_file(1);
			break;
		case KU_BT:
			music_control(MUSIC_MSG_STOP);
			func_cb.sta = FUNC_BT;
			break;
		case KL_BT:
			music_control(MUSIC_MSG_STOP);
			sys_cb.bt_mode=1;			
			func_cb.sta =FUNC_BT;
			break;
		case KU_LIGHT:
			func_sfx_ctl();
			break;
		case KL_LIGHT:
			func_set_sfx_off();
			break;
        case KL_POWER:
		case KU_POWER:
			music_control(MUSIC_MSG_STOP);
			sys_cb.pwrdwn_tone_en = 1;
			func_cb.sta =FUNC_PWROFF;
			break;
		case KU_MIC:
			func_mic_onoff_ctl();
			break;
		case MSG_SYS_1S:
			func_lower_power_check();
			func_check_timeout();
			break;
		case EVT_MODE_3P_TO_DEMO:
		case EVT_MODE_3P_TO_HOME:
			printf("3p switch!!\n");

			music_control(MUSIC_MSG_STOP);
			sys_cb.pwrdwn_tone_en = 1;
			func_cb.sta =FUNC_PWROFF;
			break;
        default:
			//auto_stop_play_timer();
            //non_volatile_memory();
            func_message(msg);
            break;
    }
}
#endif //(EX_SPIFLASH_SUPPORT & EXSPI_MUSIC)

